package com.techstar.ats.codec.history.decoder;

import io.netty.buffer.ByteBuf;
import com.techstar.ats.codec.DateTimeCodec;
import com.techstar.ats.codec.MessageDecoder;
import com.techstar.ats.dxp.history.rep.AbstractSchedule;
import com.techstar.ats.type.SubType;

public interface ScheduleDecoder<T extends AbstractSchedule> extends MessageDecoder<T> {
	default void decode(ByteBuf buf, T value) {
		value.line = buf.readUnsignedShort();
		value.datetime = DateTimeCodec.INSTANCE.get(buf);
		value.sub = SubType.valueOf(buf.readUnsignedShort());
	}
}
